<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="/WEB-INF/tld/components.tld" prefix="up"%>
<%@taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt"%>
<%@ taglib prefix="pp" uri="http://java.sun.com/jsp/jstl/fmt"%>
<jsp:useBean id="agora" class="java.util.Date" />
<%@taglib tagdir="/WEB-INF/tags" prefix="p"%>
<%@page import="java.util.Iterator"%>
<%@page import="java.util.ArrayList"%>
<%@page import="edu.up.beans.RelatoriosBean"%>

<html>
<jsp:include page="/Autorizacao.jsp" flush="false"/>
<jsp:include page="header.jsp">
	<jsp:param name="function" value="Lista de Sonhos (Vendas)"/>
</jsp:include>
<jsp:useBean id="listaRelatoriosBean" scope="session" class="edu.up.beans.RelatoriosBean"/>

<body>
<!-- begin #container -->
<div id="container">
    <!-- begin #header -->
    <div id="header">
    	<div class="headerBackground"></div>
        <div id="navcontainer">
            <ul id="navlist">
                <li ><a href="index.jsp"><up:label property="menu.home"/></a></li>
                <li><a href="Sonhos.jsp"><up:label property="menu.sonhos"/></a></li>
				<li><a href="<%=request.getContextPath()%>/RelatoriosServlet?acao=RelDepoimentos"><up:label property="menu.depoimentos"/></a></li>
				<li><a href="Login.jsp"><up:label property="menu.login"/></a></li>
				<li><a href="Sobre.jsp"><up:label property="menu.sobre"/></a></li>
				<li><up:countryOption country="Brasil" locale="pt_BR"/></li>
				<li><up:countryOption country="USA" locale="en_US"/></li>
				<li><up:countryOption country="Espanha" locale="es_ES"/></li>	
				<li><a href="<%=request.getContextPath()%>/ControleServlet?funcao=Start"><img src="images/logout.png" alt="Logout"/></a></li>
            </ul>
        </div>
    </div>
    <!-- end #header -->
    
    <!-- begin #mainContent -->
    <div id="mainContent">
        <div class="t">
        <div class="b">
        <div class="l">
        <div class="r">
        <div class="bl">
        <div class="br">
        <div class="tl">
        <div class="tr">
            <up:label property="texto.l88"/>
            <form id="frmRelatorio" name="frmRelatorio" method="post">
            <script>
            function validar(paramAcao)
			{
			
            	document.frmRelatorio.action="<%=request.getContextPath()%>/RelatoriosServlet?acao=" + paramAcao;
				document.frmRelatorio.submit();

			}
            </script>
            <br/>
            <p>
            
            <table>
            
   				<tr>
   				<up:label property="texto.l89"/>
   					<td><input type="text"  name="dtIni" size="15" maxlength="10" onkeypress="return textPick(this, event)"/></td>
   				</tr>   
   				      
            	<tr>
            	<up:label property="texto.l90"/>
   					<td><input type="text" name="dtFim" size="15" maxlength="10" onkeypress="return textPick(this, event)"/></td>
   				</tr> 
   				
   				<tr>
   					<td colspan="2"><input type="button" name="btnData" value="<up:label property="botao.filtrar" />" onclick="javascript:validar('RelVendasFiltro')" /></td>
   				</tr>
            
            </table>
            	<table border="1">
            		<tr>
            		<up:label property="texto.l91"/>
            		<up:label property="texto.l92"/>
            		<up:label property="texto.l93"/>
            		<up:label property="texto.l94"/>
            		<up:label property="texto.l95"/>
            		<up:label property="texto.l96"/>
            			
            			
            		</tr>
            		
            		<%  
            		ArrayList<RelatoriosBean> list = (ArrayList<RelatoriosBean>) request.getAttribute("listaRelatoriosBean");
            		
            		
            		for (int i = 0; i < list.size(); i++) { %>
				    <TR>
				        <TD>
				            <%=list.get(i).getVendas()[0].toString() %>
				        </TD>
				        
				         <TD>
				            <%=list.get(i).getVendas()[1].toString() %>
				        </TD>
				        
				         <TD>
				            <%=list.get(i).getVendas()[2].toString() %>
				        </TD>
				        
				         <TD>
				            <%=list.get(i).getVendas()[3].toString() %>
				        </TD>
				        
				         <TD>
				            <%=list.get(i).getVendas()[4].toString() %>
				        </TD>
				        
				         <TD>
				            <%=list.get(i).getVendas()[5].toString() %>
				        </TD>
				        
				         
				         
				        
				        
				        
				    </TR>
				<%  } %>
	
            	</table>
            	</form>
            
            <br/>
            <p><input type="button" name="btnVoltar" value="<up:label property="botao.voltar" />" onclick="javascript:history.back(-1)"/></p>

        </div>
        </div>
        </div>
        </div>
        </div>
        </div>
        </div>
        </div>
    </div>
    <!-- end #mainContent -->
    <!-- begin #footer -->
    <div id="footer">
   <br />
<br />

&nbsp; &nbsp; <strong><pp:formatDate value="${agora}"
	dateStyle="full" /></strong> &nbsp; &nbsp; || &nbsp; &nbsp; <up:label
	property="rodape.texto" /></div>
    <!-- end #footer -->
</div>
<!-- end #container -->
</body>
</html>
